#Using VoFa to draw wave datatype('FireWater')
import serial
import time
import math

ser = serial.Serial(port='/dev/ttyS0', baudrate=1152000)
ser.close()
ser.open()


try:
    t = 0
    while True:

        xw = math.sin(t)
        yh = math.cos(t)
        

        firewater_data = f"{int(xw*10)},{int(yh*10)}\r\n"

        ser.write(firewater_data.encode())

        t += 0.1

        time.sleep(0.1)

except KeyboardInterrupt:
    ser.close()